import React from 'react';
import styles from './ItemList.css';
import { Card, Input, Table, Button, Icon } from 'antd';
const {Search}=Input;
function ItemList({ service,columns }) {
  const pagination = {
      showTotal: (t) => `总计：${t}`,
      ...service.pagination
  };
  return (
    <div className={styles.normal}>
      <Card>
        <Search
          placeholder="请输入查询条件"
          size="large"
          style={{ width: 300 }}
          onSearch={qryStr =>  service.onPageChange(1, qryStr)} />
      </Card>
      <Table
        pagination={pagination}
        columns={columns}
        loading={service.loading}
        dataSource={service.dataSource}
        rowKey="id"
        bordered />
    </div>
  );
}

export default ItemList;
